#include<stdio.h>
/* *
 * What is the sum of the numbers on the diagonals in a 1001 by 1001 spiral formed in the same way?
 */

/* 2010-04-10 */
int main(void)
{
	int n;
	int span;
	int line = 1;
	int first = 3;
	int tail = 9;
	int sum = 0;
	scanf("%d", &n);

	for( span=1; span<=(n+1)/2-1; span++) {
		tail = first + span * 2 * 3;
		/**/printf("first: %d\n", first);
		/**/printf("tail: %d\n\n", tail);
		sum += 4 * first + 6 * span * 2;
		first = tail + (span + 1) * 2;
	}
	printf("%d\n", sum + 1);
 
	return 0;
}
